import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'characterChoose',
    children:[
      {path: '/manager', component: () => import('../views/manager/ManagerView.vue')},
      {path: '/shop', component: () => import('../views/shop/ShopView.vue')},
      {path: '/empeJob', component: () => import('../views/empe/EmpeJobView.vue')},
      {path: '/product', component: () => import('../views/product/ProductView.vue')},
      {path: '/storage', component: () => import('../views/product/Storage.vue')},
      {path: '/dict', component: () => import('../views/dict/DictView.vue')},
      {path: '/dictOption', component: () => import('../views/dictoption/DictOptionView.vue')},
      {path: '/empepersonal', component: () => import('../views/empe/EmpePersonalView.vue')},
      {path: '/order', component: () => import('../views/order/OrderView.vue')}
    ]
  },
  {path: '/managerLogin', component: () => import('../views/ManagerLoginView.vue')},
  {path: '/shopLogin', component: () => import('../views/ShopLoginView.vue')},
  {path: '/characterChoose', component: () => import('../views/CharacterChoose.vue')},
  {path: '/shopManage', component: () => import('../views/shopmodules/ShopManageView.vue')},
  {path: '/empeBusiness', component: () => import('../views/shopmodules/EmpeBusinessView.vue')},
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
